home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
- #Tag 0x00000f00
- #
- # $Revision: 1.6 $
- #
- IS_ON=/sbin/chkconfig
- NSS_ENABLED=0
-
- if [ -f /var/netscape/fasttrack/bin/httpd/ns-httpd ]
- then
- if $IS_ON nss_fasttrack
- then
- NSS_ENABLED=1
- fi
- fi
-
- if $IS_ON verbose; then
- ECHO=echo
- ECHOFD=1
- else # For a quiet startup and shutdown
- ECHO=:
- ECHOFD=-
- fi
-
- SGI_APACHE_HOME=/var/sgi_apache
- SROOT=$SGI_APACHE_HOME/httpd-*
-
- SVCONFIGURE=$SGI_APACHE_HOME/sgi_config/configure
-
- #
- # Warning: the freeware apache is config'd on...
- #
- if $IS_ON apache
- then
- APACHE_HOME=/usr/freeware/apache
- if [ -f $APACHE_HOME/etc/httpd.conf ]
- then
- FA_PORT=`grep "^Port " $APACHE_HOME/etc/httpd.conf | awk '{ print $2 }'`
- if [ "FA_PORT" = "80" ]
- then
- echo "sgi_apache:"
- echo "**"
- echo "** WARNING: the Freeware Apache server seems to be configured"
- echo "** to run on port 80. The Freeware server will not"
- echo "** starup properly since the sgi_apache server will"
- echo "** already be running on port 80..."
- echo "**"
- fi
- fi
- fi
-
- #
- #
- case "$1" in
- start)
- if $IS_ON sgi_apache; then
- #
- # Warning: don't start if nss_fasttrack is enabled...
- #
- if [ $NSS_ENABLED -eq 1 ]
- then
- echo "sgi_apache:"
- echo "**"
- echo "** WARNING: you must disable nss_fasttrack on this system"
- echo "** in order to allow sgi_apache to startup;"
- echo "**"
- echo "** 1. chkconfig nss_fasttrack off"
- echo "** 2. reboot"
- echo "**"
- echo "**"
- exit
- fi
- # ------------>>
- #
- $SVCONFIGURE
-
- $ECHO "Starting SGI Web Server(s)"
- for s in $SROOT
- do
- # Note: skip the httpd-gateway directory since it's
- # handled by the /etc/init.d/webface script...
- #
- case `basename $s`
- in
- ( httpd-gateway ) ;;
- ( * )
- if [ -d $s ]
- then
- if [ -x $s/sbin/apachectl ]
- then
- $ECHO "$s"
- $s/sbin/apachectl start >&$ECHOFD 2>&$ECHOFD
- if [ $? -ne 0 ]
- then
- $ECHO "Cannot start $s."
- fi
- else
- $ECHO "$s"
- $ECHO "Missing 'apachectl' for $s."
- fi
- fi ;;
- esac
- done
- fi
- ;;
- restart)
- if $IS_ON sgi_apache; then
- #
- # Warning: restart may not work if nss_fasttrack is enabled...
- #
- if [ $NSS_ENABLED -eq 1 ]
- then
- echo "sgi_apache:"
- echo "**"
- echo "** WARNING: you won't be able to restart sgi_apache until"
- echo "** after you disable nss_fasttrack on this system;"
- echo "**"
- echo "** 1. chkconfig nss_fasttrack off"
- echo "** 2. reboot"
- echo "**"
- echo "**"
- exit
- fi
- # ------------>>
- #
- $SVCONFIGURE
-
- $ECHO "Restarting SGI Web Server(s)"
- for s in $SROOT
- do
- # Note: skip the httpd-gateway directory since it's
- # handled by the /etc/init.d/webface script...
- #
- case `basename $s`
- in
- ( httpd-gateway ) ;;
- ( * )
- if [ -d $s ]
- then
- if [ -x $s/sbin/apachectl ]
- then
- $ECHO "$s"
- $s/sbin/apachectl restart >&$ECHOFD 2>&$ECHOFD
- if [ $? -ne 0 ]
- then
- $ECHO "Cannot restart $s."
- fi
- else
- $ECHO "$s"
- $ECHO "Missing 'apachectl' for $s."
- fi
- fi ;;
- esac
- done
- fi
- ;;
- stop)
- if $IS_ON sgi_apache; then
- $SVCONFIGURE
-
- $ECHO "Stopping SGI Web Server(s)"
- for s in $SROOT
- do
- # Note: skip the httpd-gateway directory since it's
- # handled by the /etc/init.d/webface script...
- #
- case `basename $s`
- in
- ( httpd-gateway ) ;;
- ( * )
- if [ -d $s ]
- then
- if [ -x $s/sbin/apachectl ]
- then
- $ECHO "$s"
- $s/sbin/apachectl stop >&$ECHOFD 2>&$ECHOFD
- if [ $? -ne 0 ]
- then
- $ECHO "Cannot stop $s."
- fi
- else
- $ECHO "$s"
- $ECHO "Missing 'apachectl' for $s."
- fi
- fi ;;
- esac
- done
- fi
- ;;
- rotate)
- if $IS_ON sgi_apache; then
- echo "sgi_apache:"
- echo "**"
- echo "** WARNING: Unable to rotate SGI Web Server(s) Logs."
- echo "** This should be configured in the individual"
- echo "** sgi_apache httpd.conf files..."
- echo "**"
- fi
- ;;
-
- *)
- echo "usage: $0 {start|stop|restart|rotate}"
- ;;
- esac
-